package mysqls

import "gorm.io/gorm"

type User struct {
	gorm.Model
	Account  string `gorm:"type:varchar(30)"json:"account"`
	Password string `gorm:"type:varchar(32)"json:"password"`
}

type Shop struct {
	gorm.Model
	ShopName string  `gorm:"type:varchar(30)"json:"shopName"`
	Price    float64 `gorm:"type:decimal(10,2)"json:"price"`
	Num      int     `gorm:"type:int"json:"num"`
	Image    string  `gorm:"type:varchar(225)"json:"image"`
	Status   string  `gorm:"type:varchar(10)"json:"status"`
}

func (s *Shop) ShopAdd() error {
	return DB.Create(&s).Error
}
